SageCrm.Net Screen Validation Issue

Hi,

Sage CRM 2021. I have a c# .net dll which shows a entry form and performs validation. It all works fine except when the validation fails. Any user inputs (except the field that failed the validation) are reset to blank. Can someone tell me what I need to do to load the form values again as I cant seem to work it out looking at the documentation ?

(I can't seem to paste my code example here as the website throws an error!)

  • 0

    private void BuildScreen(bool isValidated)
    {
        
        base.GetTabs("Visit", "Summary");
        base.AddContent(base.HTML.StartTable());
        base.AddContent(base.HTML.InputHidden("HiddenMode", ""));
        base.AddContent(base.HTML.BoxTitle("Change Planned Invoicing Details"));
    
        if(isValidated)
        {
            screen.Fill(visitRecord);
            base.AddContent(base.HTML.BoxContent(screen.GetHtmlInEditMode(visitRecord)));
        }
        else
        {                         
    		 // This bit is not working
    		Entity entity = new Entity("Visit");
    		screen.Fill(entity);
    		base.AddContent(base.HTML.BoxContent(screen.GetHtmlInEditMode()));
    
            base.AddContent(base.HTML.BoxContent(html));
        }