Notifications
Announcements
No record found.
Hi Team ,
I have added existing form (Sales order details) to the current project . And in the form design added two controls..one is check box and other one button in Line Overview Action Pane .Here i am confusing in COC and event handler, which one is a good approach to achieve the action .
Action: When i click the button then the checkbox will be unmarked to related sales lines details .Kindly suggest me the solution for this.
Thanks,
Prasad N.
Hi prasadn.nampalli,
Its upto you. You can write either event handler or COC. Also tell me whether check box is DataSource bound control or not?
You can go for COC because you can get the control name by simply setting the "Auto declaration" property to yes and you can use it in clicked method of the button control.
[Extensionof(formcontrolstr(FormName,controlname))] final class className_Extension { public void clicked() { next clicked(); YourCheckBoxControlName.value(false); } }
Girish S.
Hi Girish,
Thanks for your suggestion..
I tried with the COC but here checkbox is of type Noyes enumarator type .
getting error while declaring the sentence .Please suggest me
Yes, Check box is bound to data source ..added new field at table level .
If control is bound to DataSource, then you need to update all the line records because there may be one or more lines.
Can you show as a screenshot of the form UI with new controls added in it?
Hi Prasad,
Can you please send the error here?
Also if it is a NoYes control then you might have added that to the datasource and then to form. So basically you need to update that with coding. You can take onclicked eventhandler/onclicked method in which you need to take that table buffer and update that NoYes value like below.
MyFieldName = NoYes::No;
myTableName.update;
Thanks
Bharani Preetham
Sorry for the late reply, here i am adding the screenshot of UI with added control highlighted with red line .
Please see the below screenshot and guide me .
Seems you have added the field at table level. So, your code should update all the sales lines against the sales header upon clicking of the button. You can use either COC or event handler. COC will be easier since you can get access to variables easily.
[Extensionof(formcontrolstr(FormName,controlname))] final class className_Extension { public void clicked() { next clicked(); SalesTable salesTable; SalesLine salesLine; salesTable = element.SalesTable; ttsbegin; while select for update * from salesLine where salesLine.SalesId == salesTable.SalesId { salesLine.checkBoxName = NoYes::No; salesLine.update(); } ttscommit; } }
Thanks for your quick reply...i will apply the same logic and will update you whether it's working or not .
When i click on the cleck box it is not marked...before applying the logic,What is the cause for this why the checkbox not marked. kindly help me on this
When you created new check box field in table, by default for all the lines it will not be marked.
To do that you need to set the initial "value" of the check box control to 1 or add your code in the initValue method of DataSource.
So, your functionality will work when you create new sales orders and lines after setting the initial value as mentioned above.
For existing lines, you need to write a script to update the value of check box to marked.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 672 Most Valuable Professional
André Arnaud de Cal... 534 Super User 2025 Season 2
Sohaib Cheema 289 User Group Leader