February 25, 201312 yr Newbies I am a beginner for scripting and I like to do a multiple if statement script like: if "this=x" and "this=y" then "result=z" please find the attached picture of my script. I tryed to do that but it isn't working. Maybe only missed some ( [ ] ) mark or something? Could somebody fix my code or suggest a different solution? Thank you GaborÂ
February 25, 201312 yr In addition to $quantity not being defined, why are the last two Else If conditions separate, since they both do exactly the same thing?
February 25, 201312 yr I think you are trying to say --- If X is true AND Y is true do something but if ONLY X is true then do something else: If X is true and Y is true; do something; Else if X is true and Y is not true; do something else; This (the Y being not true) could be as simple as the status field NOT equal to whatever it is equal to in the first statement. hth, Martie
February 25, 201312 yr Author Newbies Hi thanks for the answers. Sorry I forget to remove the last line. It is a script when I push a "Commit from invetory" button in an invoice then it removes the quantities from the related product stock, then locks the line items on the invoice (I can't modify after this) When I push the "Revert Inventory" button then change everything back. This works perfectly but I like to extend this script to the replacement extension. I mean if the invoice status is replacement then when I push the "Commit from inventory"button then add the quantites to the Ammount_Faulty field on the related product as well. The main thing is the first line. That formula doesn't work, I don't know the right way, because I am not a programer. How can I define like  If Get (ScriptParameter) = "commit" and T12_INVOICES::Status="Replacement"  Sorry for my language I hope somebody understand what am I want. Tanks Gabor Â
February 25, 201312 yr Author Newbies Sorry, this is only part of the full script. MartieH yes you right. But my formula on the first attachment doesn't work. Maybe I missed semicolons ( or brackets. Could you please help?
February 27, 201312 yr Hi thanks for the answers. Sorry I forget to remove the last line. It is a script when I push a "Commit from invetory" button in an invoice then it removes the quantities from the related product stock, then locks the line items on the invoice (I can't modify after this) When I push the "Revert Inventory" button then change everything back. This works perfectly but I like to extend this script to the replacement extension. I mean if the invoice status is replacement then when I push the "Commit from inventory"button then add the quantites to the Ammount_Faulty field on the related product as well. The main thing is the first line. That formula doesn't work, I don't know the right way, because I am not a programer. How can I define like  If Get (ScriptParameter) = "commit" and T12_INVOICES::Status="Replacement"  Sorry for my language I hope somebody understand what am I want. Tanks Gabor  Does your commit button send in the script parameter?
Create an account or sign in to comment