SalesLogix Null Values - saleslogix

I am working on SalesLogix 7.5 C#.
I have an aspx page which has a text-box as a control which is a mandatory field. When i enter some data and save, it is saved. Now, when i edit that record and make that text-box as blank it gives me an Error Message saying that this is a mandatory field please enter some value.
Now when I enter the same value as it was before editing, it still shows me the text-box as blank.
Example:
I put "James" in the textbox and save.
On editing: i made it blank (recieved an error message).
Again I entered : "James" (Got the same Error Message)

Sorry, unable to add a comment to the original question but need some more information.
Are you doing this via App Architect or in ASP.NET outside of SalesLogix?
Are you doing this as a QuickForm or a custom SmartPart?
Can you provide the tag for the field that isn't working and the relevant lines from the OnAddEntityBindings function in the .aspx.cs?
Have you stepped-through via the Visual Studio Debugger your btnSave_Click code to check it's saving correctly?

Related

Django - How can I remove some of the text displayed on the admin 'add user' page?

I currently have a system where the admin is the only way to add a user to the site. All they need to do is put in thier email and they will be sent a link allowing them to create a password and set up thier account. This is all working fine.
The problem I have is shown in the image below, when the admin goes to add the user through the interface I am still greeted with the old text from the page, which I obviously do not want.
"First, enter a username and password. Then, you'll be able to edit more user options."
I obviously just want this original text removed and my description about entering an email to remain.
I have found the text in the "add_form.html", but I dont believe the right solution is to delete it from there, so I am looking for a way to remove that text?
I have found the text in the "add_form.html", but I dont believe the
right solution is to delete it from there
You should not delete it from there, you need to override it:
Copy original add_form.html template
Edit it as you need
Put new edited template in folder your_project_TEMPLATES_DIRS_path_from_settings_py/admin/auth/user
Checked it in my project, works fine.

How to fill dynamic form fields using capybara

I have a form that contains a select box and a text field.
The text field is displayed dynamically based on the selectbox selection. If the value of selectbox is "Yes", then the text field will be displayed and vice versa.
I am running an rspec test and filled the select box value with "Yes"
select 'Yes', from: 'property[have_water_bills]'
Now i want to fill a value on the text field
fill_in 'property[irrigation_cycle_count]', with: 5
But i am getting the following error.
Capybara::ElementNotFound:
Unable to find field "property[irrigation_cycle_count]"
That is, capybara cannot find the dynamic element. Does anyone know how to fix this?
Poltergeist doesn't gemerate a click event when choosing an item from a select. It generates a focus on the option, change on the select, blur on the option. It is more like if a user selected the option with keyboard instead of using a mouse. You probably should be doing the logic to display your text field on the change event anyway so that it works if people use a mouse or a keyboard to navigate around your page. It also makes more sense to run your show/hide logic on the change event because that's what you actually care about, not clicks.
Finally got this to work using the following piece of code
page.execute_script("$('#have_water_bills').val('true').trigger('click')")

No results message using display templates

I have a sharepoint 2013 site with a page that uses the CSWP and a custom display template. When there are no results, I want to display a message that says "Share What's Going On". I tried setting the $noResults variable in the display template, but nothing displays. When I set a breakpoint on that same line, the browser doesn't break.
How do I display a "no results" message?
Thanks
Jim
You'll need to set the EmptyMessage web part property value. The property is hidden so you'll have to set it programmatically or by exporting the web part and editing the .webpart file.
Think this link have your answer:
Link for changing $noResults

Passing a text field value into popup page using URL

I am trying to pass the value of a text field from one page to another using the URL but failing miserably.
The reason for this is as follows:
I have an apex page which displays a machines properties (make, model, what products it makes, machine ID (:P1_INPUT)). Some machines can only make one product, other can make a variety.
I use a query to complete the following: If the machine only makes one type of product , the product number is displayed in :P1_item. If a machine can make more than one product it displays in :P1_item the world 'multiple'.
I want to build in the ability to click on a button next to :P1_Item, a popup appears with the products the machine makes if ‘multiple’ is displayed. I have the popup bit working but its not passing my :P1_INPUT from the page to the popup page text field :P3_OUPUT
The following code i have on the button, so when it is clicked, it opens a popup page (this works) and should populate the text field (P3_OUTPUT) with the value passed from P1_INPUT (this doesnt work).
My button is set to Redirect to URL and i have this in the URL target.
javascript:popupURL('f?p=&APP_ID.:HELLOWORLD:&SESSION.:::&P3_OUTPUT.:&P1_INPUT.')
I cant use a branch because i dont want the main page showing the machine properties to submit.
Your URL is wrong: f?p=&APP_ID.:HELLOWORLD:&SESSION.:::&P3_OUTPUT.:&P1_INPUT. : you want to provide a value for the item P3_OUTPUT while you have set &P3_OUTPUT. which is a substitution string and would put the value of P3_OUTPUT in the string.
You need to set the URL to f?p=&APP_ID.:HELLOWORLD:&SESSION.::::P3_OUTPUT:&P1_INPUT., which would correctly set the value of P3_OUTPUT and add an extra semi-colon between the session identifier and the arguments-values pair.

property sheet data validation

When the user clicks the OK or APPLY button on a property sheet and the program determines data on some page is invalid, how can I cause the page containing the error to be displayed along with a message box describing the error?
Currently the procedure doing the validation does the following while processing the PSN_APPLY notification.
MessageBox (hDlg, "Data must be positive!", "Error", MB_OK);
SetWindowLong (hDlg, DWL_MSGRESULT, PSNRET_INVALID);
This works ok if the page doing the validation (A) is currently displayed but if some other page (B) is being displayed, the message box appears with that page (B) being displayed, then when the message box is answered, the page with the validation error (A) is displayed. I thought about setting some flag so that when that page (A) gets the PSN_SETACTIVE notification it displays the message box but that seems kind of hokey.
Win32 API in c++, no MFC, no NET, nothing fancy.
I think the problem is in the design of your validation and it's presentation.
Am I right in thinking that you iterate through your property sheets, validate them and display a message box if something is awry? Because of course, what you have witnessed will happen, if I am on property page 3 and I wrote crap in to a field on property page 1.
The easiest solution is, when validating, note which property page the field in question is, and set that one active if the user has written crap in to one of your fields. This seems the fastest way possible.
Also, rather than spring up an annoying message box, reserve some room beneath the property pages to display a textual (red or otherwise) warning as to why, and then change to the appropriate property page, and highlight the offending control. Your validation routine can do this nice and easily as it loops through.
Even better, don't stop at the first error. One thing I HATE is correcting one field that I think is the only issue, only to be told every time I hit "OK" or "SUBMIT" that there's something else I missed.
I seriously think you should consider going the extra mile here... loop through ALL controls, and add all invalid ones to a list. Then change each offending control's background colour, tab colour etc... Then the user can work through and correct, no matter how many errors he or she made.