DRAhmed
-
Posts
58 -
Joined
-
Last visited
Reputation Activity
-
DRAhmed reacted to kpcollier in how to merge 2 fields
Could also download the data into something like Excel, merge them yourself, and then upload the updated values into the table.
-
DRAhmed reacted to cheonsa in change checkbox when updated
Hi @DRAhmed,
Kindly enclose the CSS code in the style tag.
<style> [class*=cbFormBlock173], [class*=cbFormBlock174] { display: none !important;; } </style>
-
DRAhmed reacted to SushiPizza in change checkbox when updated
Hi DRAhmed,
You can use this simple Triggered Action for this functionality:
If you do not have access to Triggered Actions, you can use the script below in the Footer of the Details page. Please remember to disable the HTML editor or press the Source button before pasting the code. You will also need to replace "CheckboxField" with your Field name (leave the EditRecord part before the name).
<script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function (event) { document.getElementById("EditRecordCheckboxField").checked = true; }); </script> I hope that helps!
Regards,
SP
-
-
DRAhmed reacted to Ilyrian in uncheck if
In this case you could use the following:
We need to add this:
var textfield1= document.getElementById('InsertRecordText2') and
textfield1.value= " "; - code that clears the value inside texfield
<script type = "text/javascript" > if (typeof mainF == 'undefined') { const mainF = function(event) { var checkbox1 = document.getElementById('InsertRecordYesNo1') var checkbox2 = document.getElementById('InsertRecordYesNo2') var textfield1= document.getElementById('InsertRecordText2') if (checkbox1.checked == true) { checkbox2.checked = false; textfield1.value= " "; } else if (checkbox1.checked == false) { checkbox2.checked = true; } if (checkbox2.checked == false) { checkbox1.checked = true; } else if (checkbox2.checked == true) { checkbox1.checked = false; } checkbox1.addEventListener('change', function() { if (checkbox1.checked == true) { checkbox2.checked = false; textfield1.value= " "; } else if (checkbox1.checked == false) { checkbox2.checked = true; } }); checkbox2.addEventListener('change', function() { if (checkbox2.checked == false) { checkbox1.checked = true; } else if (checkbox2.checked == true) { checkbox1.checked = false; } }) document.removeEventListener('DataPageReady', mainF) } document.addEventListener('DataPageReady', mainF) } </script>
-
DRAhmed reacted to Ilyrian in uncheck if
I am not sure why it is not working. Here is the code I am using:
Here is Deployed DP: https://c8cmr089.caspio.com/dp/02cab0002bcb175c66c546a79b27
<script type = "text/javascript" > if (typeof mainF == 'undefined') { const mainF = function(event) { var checkbox1 = document.getElementById('InsertRecordYesNo1') var checkbox2 = document.getElementById('InsertRecordYesNo2') var textfield1= document.getElementById('InsertRecordName') if (checkbox1.checked == true) { checkbox2.checked = false; textfield1.value= " "; } else if (checkbox1.checked == false) { checkbox2.checked = true; } if (checkbox2.checked == false) { checkbox1.checked = true; } else if (checkbox2.checked == true) { checkbox1.checked = false; } checkbox1.addEventListener('change', function() { if (checkbox1.checked == true) { checkbox2.checked = false; textfield1.value= " "; } else if (checkbox1.checked == false) { checkbox2.checked = true; } }); checkbox2.addEventListener('change', function() { if (checkbox2.checked == false) { checkbox1.checked = true; textfield1.value= " "; } else if (checkbox2.checked == true) { checkbox1.checked = false; } }) document.removeEventListener('DataPageReady', mainF) } document.addEventListener('DataPageReady', mainF) } </script>
-
DRAhmed reacted to Ilyrian in uncheck if
I can see that you are using Details DataPage. In this case change the following part of the code from:
var checkbox1 = document.getElementById('InsertRecordhandover') var checkbox2 = document.getElementById('InsertRecordapproved') var textfield1= document.getElementById('InsertRecordprocess_notes') to this:
var checkbox1 = document.getElementById('EditRecordhandover') var checkbox2 = document.getElementById('EditRecordapproved') var textfield1= document.getElementById('EditRecordprocess_notes') Also note that when using the Details DataPage, instead of Insert keyword, we should use Edit. Change also the naming of your fields accordingly.
var checkbox1 = document.getElementById('EditRecordleft_egypt') var checkbox2 = document.getElementById('EditRecordfollow_checkbox') var textfield1= document.getElementById('EditRecordwhen_to_follow')
-
DRAhmed reacted to Ilyrian in uncheck if
Hi @DRAhmed
You can try the following code:
Change Your_CHECKBOX1 and Your_CHECKBOX2 based on your checboxes
<script type = "text/javascript" > if (typeof mainF == 'undefined') { const mainF = function(event) { var checkbox1 = document.getElementById('Your_CHECKBOX1') var checkbox2 = document.getElementById('Your_CHECKBOX2') if (checkbox1.checked == true) { checkbox2.checked = false; } else if (checkbox1.checked == false) { checkbox2.checked = true; } if (checkbox2.checked == false) { checkbox1.checked = true; } else if (checkbox2.checked == true) { checkbox1.checked = false; } checkbox1.addEventListener('change', function() { if (checkbox1.checked == true) { checkbox2.checked = false; } else if (checkbox1.checked == false) { checkbox2.checked = true; } }); checkbox2.addEventListener('change', function() { if (checkbox2.checked == false) { checkbox1.checked = true; } else if (checkbox2.checked == true) { checkbox1.checked = false; } }) document.removeEventListener('DataPageReady', mainF) } document.addEventListener('DataPageReady', mainF) } </script>
-
DRAhmed reacted to Queso in calculation not working
Hello,
Thank you for the question and solution!
Just to add, the following article lists all available functions that you can use for your Calculated Field and please note that some functions such as SysUTCDateTime() are not available in the Table level's Formula Field: https://howto.caspio.com/function-reference/#:~:text=Date-,SysUTCDateTime(),-Current system timestamp
-
DRAhmed reacted to autonumber in calculation not working
Hi @DRAhmed- as I understand, your condition will be, if the checkbox is checked AND the field date IS NOT EQUAL to todays date in 103 format, it should return yes otherwise no.
can you try this formula?
CASE WHEN [@field:Send_Email] = 1 AND CONVERT(VARCHAR,[@field:Date_],103) != CONVERT(VARCHAR,SysUTCDateTime(),103) THEN 'Yes' ELSE 'No' END
-
DRAhmed reacted to IamNatoyThatLovesYou in save the calculated date
Hello @DRAhmed, you may try having custom localization and set it to your time zone and use it in the datapage.
-
DRAhmed reacted to Kurumi in date when checkbox is checked
Hi @DRAhmed - what is your expected result? Do you have sample data?
-
DRAhmed reacted to Kurumi in check unique field before proceeding
Hi @DRAhmed - you can check these posts for similar use case:
After checking a record, you can have a custom code/JavaScript that will prevent the form from submission.
-
DRAhmed reacted to IamNatoyThatLovesYou in check unique field before proceeding
Hello @DRAhmed, it is expected that the field would only be verified on submit to check if the record is in the table. You may check with our developers regarding this to see if they can may it in real-time instead. You may reach out to them here.
-
DRAhmed reacted to Tubby in disable checkbox after being checked
Sorry, yes I tried creating it back and it isnt working. Not sure what went wrong as this is a known workaround of mine. I don't know what else to try. Maybe anyone else has some other workarounds.
-
DRAhmed reacted to Ilyrian in date when checkbox is checked
Hi
You can try the following code:
You can change the GMT Standard Time with your desired Time Zone.
You can as well change the '100' format to desired one, you can chose from one of these options: https://www.w3schools.com/sql/func_sqlserver_convert.asp
Case WHEN [@field:arrived_at_company]= 1 Then (SELECT CONVERT(VARCHAR, CONVERT(DATE, GETDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'GMT Standard Time'), 100) AS [Date_Result]) End
-
DRAhmed reacted to Flowers4Algernon in unable to find a way to create the desired app
Hello! Might I also suggest reaching out to Caspio's Professional Services team as they have helped me create my application before. You may reach out to them here: https://www.caspio.com/services/professional-services/
-
DRAhmed reacted to futurist in disable checkbox after being checked
Hi @DRAhmed,
You can use the following script:
<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {
const selectElement = document.querySelector('#InsertRecordYesNo');
selectElement.addEventListener('change', (event) => {
if(selectElement.checked = true){
document.querySelector("#InsertRecordYesNo").disabled = true;
}
});
});
</script>
Make sure to change "YesNo" in "InsertRecordYesNo" to your actual Yes/No field name.
One question though. What if the checkbox is checked to begin with?
-
DRAhmed reacted to futurist in disable checkbox after being checked
Just to add to this, you can actually do this using Rules.
You can put your Yes/No field in its own section,
So that when you set up the Rule, you use the Yes/No field for the criteria, but use its section for the action:
-
DRAhmed reacted to Tubby in disable checkbox after being checked
Yes, because fields that are disabled by Rules tends to not get submitted. What you can do is this:
Create a Virtual field that will act as your Checkbox.
Make your Actual Yes/No field's form element as Calculated Value and make it hidden(Advanced tab)
Use a CASE statement to get the value from the Virtual field:
CASE WHEN [@cbParamVirtual1] = 'Y' THEN CAST('1' AS BIT) ELSE CAST('0' AS BIT) END
Then use the suggestion of @futurist to disable the Virtual checkbox. DO NOT include the actual Yes/No field in the section that you are going to disable. It should only contain the virtual checkbox.
-
DRAhmed reacted to Tubby in disable checkbox after being checked
Oh, unhide the calculated value and check if it is getting any value. it might be getting NULL. if yes, try using single quotes for the virtual field.
CASE WHEN '[@cbParamVirtual1]' = 'Y' THEN CAST('1' AS BIT) ELSE CAST('0' AS BIT) END
Or check your virtual field's "value when checked" and see if you have Y there. You might have a different value than what I use.
-
DRAhmed reacted to GoodBoy in calculation in a rule
You can use the DatePart function in a formula field to have this format for your date values. For example:
DatePart(month, [@field:DateField]) + '/' + DatePart(year, [@field:DateField])
-
DRAhmed reacted to GoodBoy in calculation in a rule
Hello. You can just add the parameter for that field by choosing it in the field picker. For example:
Case WHEN DatePart (year, SysUTCDateTime()) - CAST ( [@field:bach_year] as int) >= 2 Then "spec" + '' + [@field:FieldName] Else "a" End
-
DRAhmed got a reaction from CoopperBackpack in calculation in a rule
so i changed the data type from number to text field
when i try it , it shows Calculation error in calculated field
i refreshed the page and it works perfectly now
thank you so much
-
DRAhmed reacted to CoopperBackpack in calculation in a rule
Hello @DRAhmed,
It is definitely possible to calculate difference in years. Could you provide more details to suggest you the solution that works as expected?
1) Should 2022 be hardcoded? Or do you need to use the current year (for example, in 2023 you need to use 2023 for the rule)?
2) Since it is a Submission form I assume that the user enters the date that you want to use to calculate the difference in years.
Is it a full date like 05/01/2020? Or is is just a year in the Text(255), Number or Integer field like 2020?
3) If the user only enters a year and you need to calculate the difference between the entered year and the current year, you may test these formulas (replace the [@field:year_field] with your field name):
If the year has the Integer or Number data type: DatePart (year, SysUTCDateTime()) - [@field:year_field]
If the year has the Text(255) data type: DatePart (year, SysUTCDateTime()) - CAST ( [@field:year_field] as int)